FROM kong:2.0.4-centos
LABEL maintainer="yurui"

USER root
#COPY ./jwt-plus  /go/kong-lua/jwt-plus
#
#RUN cd /go/kong-lua/jwt-plus && luarocks make
#RUN cd /go/kong-lua/jwt-plus && luarocks pack kong-plugin-jwt-plus 0.1.0-1
#RUN cd /go/kong-lua/jwt-plus && luarocks install kong-plugin-jwt-plus 0.1.0-1
#RUN mkdir -p /usr/local/share/lua/5.1/kong/plugins/simple
#COPY simple                  /usr/local/share/lua/5.1/kong/plugins/simple
COPY ./kong-plugin  /go/kong-lua/kong-plugin
COPY ./main.so   /usr/local/kong/go-plugins/
#RUN cd /go/kong-lua/kong-plugin \
#    && ls -al ./kong/plugins/myplugin \
#    && ls -al ./kong/plugins/jwt \
#    && luarocks make
#
#RUN ls -al /usr/local/share/lua/5.1/kong/plugins
RUN setcap cap_net_bind_service=+eip /usr/local/openresty/nginx/sbin/nginx

USER kong

ENTRYPOINT ["/docker-entrypoint.sh"]

EXPOSE 8000 8443 8001 8444


STOPSIGNAL SIGQUIT

CMD ["kong", "docker-start"]